% ECG_NORMALIZE        Normalize the ECG input signal
% Usage:
% [v,t] = ecg_normalize(data);
% [v,t] = ecg_normalize(data,Samp_freq)
%
% Inputs:
% data: raw signal in 16bit format
% Samp_freq: sampling frequency of the signal
% 
% Outputs:
% v: calibrated signal in volt
% t: time in second
%
% Copyright: Group 8
% Modified at 20th Oct 2010
%-------------------------------------------------------------------------
function [v,t] = ecg_normalize(data,Samp_freq)
% Setting input condition
if(nargin < 2)
    Samp_freq=553.6;
end
% Normalize our ecg data for reconstruction and data-type transform
t = (0:length(data)-1)/Samp_freq;
v = double(data)*5/65536;
end
